home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / dev / gui / gui4cli.lha / Gui4Cli / INSTALL < prev    next >
Text File  |  1998-10-22  |  8KB  |  307 lines

  1. G4C
  2.  
  3. ; This is a program for the installation of Gui4Cli to your system.
  4.  
  5. ; Click on it's icon to install.
  6.  
  7. ; Comodore's Installer, would do a better job, but since I don't
  8. ; know how to write scripts for it, and since this is an other
  9. ; excuse for making a gui, here it is.
  10.  
  11. ; If you have any problems (God forbid), just install it by hand.
  12. ; Instructions are in the ReadMe.now file 
  13.  
  14.  
  15. WINBIG 171 12 320 139 "Install Gui4Cli"
  16. WinType 11110001
  17. WinOut "con:0/12/400/80/Gui4Cli Installation/CLOSE/AUTO/WAIT"
  18.  
  19. BOX 0 0 0 0 out button
  20. BOX 10 5 300 68 in button
  21. BOX 10 95 300 39 IN BUTTON
  22.  
  23. ;--------------------------------- Start up events --------------------
  24.  
  25. xOnLoad
  26. extract Install GUIPATH path
  27. cd $path
  28.  
  29. ; --------- Check to find gui4cli
  30.  
  31. joinfile $path Gui4Cli g4cname
  32. ifexists file $g4cname
  33.    ; ok
  34. else
  35.    ezreq "Gui4Cli not found.\nPlease read the ReadMe.now\nfile and try again" "OK" ''
  36.    Quit
  37. endif
  38.  
  39. ; --------- Set default variable values
  40.  
  41. dir     = SYS:Gui4Cli
  42. dirinfo = SYS:Gui4Cli.info
  43. assign  = ON
  44. dirmake = YES
  45.  
  46. ; --------- Warn user if Gui4Cli already exists
  47.  
  48. ifexists assign GUIs
  49.    if guis: F= $path
  50.       ; it's ok it's this dir
  51.    else
  52.       dirmake = NO
  53.       dir     = GUIs:
  54.       assign  = OFF
  55.       update Install 7 0
  56.       update Install 2 "Directory exists."
  57.    endif
  58. endif
  59. GuiOpen Install
  60. update Install 1 $dir
  61.  
  62. xOnClose
  63. Quit
  64.  
  65. ;------------------------------ Install Gui4Cli program -----------------
  66.  
  67. CTEXT 20 10 "Gui4Cli Installation" topaz.font 8 2 0 0001
  68.  
  69.  
  70. XBUTTON 210 10 89 14 "Browse.."
  71. gdir = ''
  72. ReqFile -1 -1 250 -60 "Choose path for Gui4Cli" DIR gdir $dir
  73. if $gdir != ""
  74.    joinfile $gdir Gui4Cli dir
  75.    joinfile $gdir Gui4Cli.info dirinfo
  76.    ifexists DIR $dir
  77.         dirmake = NO
  78.         assign  = OFF
  79.         update Install 7 0
  80.         update Install 2 "Directory Gui4Cli exists"
  81.    else
  82.         dirmake = YES
  83.         assign  = ON
  84.         update Install 7 1
  85.         update Install 2 "Will create Directory Gui4Cli"
  86.    endif
  87.    update Install 1 $dir
  88. endif
  89.  
  90.  
  91. TEXT 20 25 280 14 "sys:" 120 BOX
  92. GadID 1
  93.  
  94.  
  95. TEXT 20 40 280 14 "Creates Directory named Gui4Cli" 60 NOBOX
  96. GadID 2
  97.  
  98.  
  99. TEXT 20 55 280 14 "File Gui will be copied to c:" 50 NOBOX
  100. GadID 3
  101.  
  102.  
  103. ;====================> Assign GUIs:
  104.  
  105. TEXT 20 80 236 11 "Add commands to User-Startup?" 30 NOBOX
  106. GadID 4
  107.  
  108. XCHECKBOX 260 80 26 13 "" assign "ON" "OFF" ON
  109. gadID 7
  110.  
  111.  
  112. ;----------------------- Run Install -------------------------------
  113.  
  114. XBUTTON 25 115 100 14 Install!
  115.  
  116.     SetWinTitle Install "Installing..."
  117.     guiwindow install wait
  118.     FailAt 10
  119.  
  120.     ; copy Gui
  121.     copy gui c:
  122.     update Install 3 "File Gui copied."
  123.     update Install 10 5   ; gauge
  124.  
  125.     ; Make G4C dir & dir icon
  126.     if $dirmake = YES
  127.        makedir $dir
  128.        copy g4cdrawer $dirinfo
  129.        update Install 2 "Gui4Cli dir created."
  130.        Assign GUIs: $dir
  131.     endif
  132.     update Install 10 10   ; gauge
  133.  
  134.     ; add the assign to s:user-startup
  135.     if $assign = ON
  136.            update Install 4 "Assigning..."
  137.            Append s:user-startup "\n;START of Gui4Cli assign\n"
  138.            Append s:user-startup 'Assign GUIs: $dir \n'
  139.            Append s:user-startup 'Path GUIs:c add\n'
  140.            Append s:user-startup ";END of Gui4Cli assign\n"
  141.            update Install 4 "GUIs: Assign added."
  142.     endif
  143.     update Install 10 15   ; gauge
  144.  
  145.     ; copy the fonts - no longer..
  146.     ; update Install 1 "Copying font..."
  147.     ; copy fonts/#? fonts:
  148.     ; update Install 10 20   ; gauge
  149.  
  150.     ; ----- copy the files
  151.  
  152.     ; tools
  153.     update Install 1 "Copying Tools..."
  154.     ; get & save new players
  155.     joinfile $dir "tools/prefs/players" playfile
  156.     ifexists file $playfile
  157.        guiload tools/prefs/players
  158.        guiload $playfile            ; overlay old prefs
  159.        flag = 1
  160.     endif
  161.     action copy tools $dir
  162.     if $flag = 1
  163.        gosub install saveprefs
  164.     endif
  165.     ; check favourites files
  166.     gosub install savefavs
  167.     update Install 10 40
  168.  
  169.     ; C
  170.     update Install 1 "Copying C..."
  171.     copy c $dir
  172.     update Install 10 45
  173.  
  174.     ; docs
  175.     update Install 1 "Copying Docs..."
  176.     action copy docs $dir
  177.     update Install 10 60
  178.  
  179.     ; dir.gc
  180.     update Install 1 "Copying Dir.gc..."
  181.     joinfile $dir dir/dir.user userfile
  182.     ifexists file $userfile
  183.         rename dir/dir.user dir/dir.user.empty
  184.     endif
  185.     copy Dir $dir
  186.     update Install 10 70
  187.  
  188.     ; G4C
  189.     update Install 1 "Copying G4C..."
  190.     copy G4C $dir
  191.     update Install 10 80
  192.  
  193.     ; ------- copy the files
  194.     ; icons
  195.     update Install 1 "Copying Files..."
  196.     rename Install.info ginfo        ; so that it's not copied
  197.     copy #?.info $dir
  198.     rename ginfo Install.info
  199.     update Install 10 85
  200.  
  201.     ifexists file c:Gui4Cli
  202.        delete c:Gui4Cli
  203.     endif
  204.     copy Gui4Cli $dir
  205.     update Install 10 95
  206.  
  207.     copy Gui4Cli.gc     $dir
  208.     copy Demo.gc        $dir
  209.     copy ReadMe.now     $dir
  210.     update Install 10 100
  211.  
  212.     update Install 1 "Gui4Cli Installed."
  213.  
  214.     cli 'c:path guis:c add'
  215.     SetWinTitle Install "Gui4Cli Installation"
  216.     guiwindow install resume
  217.     ezreq "Installation finished.\nGui4Cli can be found in\n$dir" "Yeah!" ""
  218.  
  219.     ; quit since this is another port
  220.     ifexists port Gui4Cli
  221.        else
  222.        run 'gui guis:Gui4Cli.gc'
  223.     endif
  224.     Quit
  225.  
  226. ;------------> On failing
  227.  
  228. xOnFail
  229. SetWinTitle Install "**** ERROR ****"
  230. guiwindow install resume
  231. EZREQ "ERROR in installation\nPlease read the ReadMe.Now file\nand install manually." "OK" ""
  232. Quit
  233.  
  234. ;----------------------- Cancel button ------------------------------
  235.  
  236. XBUTTON 200 115 100 14 CANCEL
  237. Quit
  238.  
  239.  
  240. GAUGE 22 99 281 13 IN RIDGE 3 0 0
  241. gadid 10
  242.  
  243.  
  244. ; --------------------------- ROUTINES -------------------------
  245. ; Same routine as in guis:tools/config.gc
  246.  
  247. xroutine saveprefs
  248. .dir.prefs = "G4C - Players\n\nxOnLoad\n"
  249. append env:.dir.prefs '*DEF.EDITOR    = \"$*DEF.EDITOR\"\n'
  250. append env:.dir.prefs '*DEF.ILBM      = \"$*DEF.ILBM\"\n'
  251. append env:.dir.prefs '*DEF.ANIM      = \"$*DEF.ANIM\"\n'
  252. append env:.dir.prefs '*DEF.GIF       = \"$*DEF.GIF\"\n'
  253. append env:.dir.prefs '*DEF.JPG       = \"$*DEF.JPG\"\n'
  254. append env:.dir.prefs '*DEF.GFX       = \"$*DEF.GFX\"\n'
  255. append env:.dir.prefs '*DEF.PAINT     = \"$*DEF.PAINT\"\n'
  256. append env:.dir.prefs '*DEF.GFXCON    = \"$*DEF.GFXCON\"\n'
  257. append env:.dir.prefs '*DEF.SMPL      = \"$*DEF.SMPL\"\n'
  258. append env:.dir.prefs '*DEF.MOD       = \"$*DEF.MOD\"\n'
  259. append env:.dir.prefs '*DEF.GUIDE     = \"$*DEF.GUIDE\"\n'
  260. append env:.dir.prefs '*DEF.LHA       = \"$*DEF.LHA\"\n'
  261. append env:.dir.prefs '*DEF.ZIP       = \"$*DEF.ZIP\"\n'
  262. append env:.dir.prefs '*DEF.UNZIP     = \"$*DEF.UNZIP\"\n'
  263. append env:.dir.prefs '*DEF.HEX       = \"$*DEF.HEX\"\n'
  264. append env:.dir.prefs '*DEF.PP        = \"$*DEF.PP\"\n'
  265. append env:.dir.prefs '*DEF.PPM       = \"$*DEF.PPM\"\n'
  266. append env:.dir.prefs '*DEF.TGA       = \"$*DEF.TGA\"\n'
  267. append env:.dir.prefs '*DEF.PNG       = \"$*DEF.PNG\"\n'
  268. append env:.dir.prefs '*DEF.FONT      = \"$*DEF.FONT\"\n'
  269. append env:.dir.prefs '*DEF.HTML      = \"$*DEF.HTML\"\n'
  270. append env:.dir.prefs '*DEF.GFXED     = \"$*DEF.GFXED\"\n'
  271. append env:.dir.prefs '*DEF.FLC       = \"$*DEF.FLC\"\n'
  272. append env:.dir.prefs '*DEF.AVI       = \"$*DEF.AVI\"\n'
  273. append env:.dir.prefs '*DEF.MPG       = \"$*DEF.MPG\"\n'
  274. append env:.dir.prefs '*DEF.QT        = \"$*DEF.QT\"\n'
  275. append env:.dir.prefs '*DEF.MPGA      = \"$*DEF.MPGA\"\n'
  276. append env:.dir.prefs '*DEF.DT        = \"$*DEF.DT\"\n'
  277. append env:.dir.prefs "GuiQuit Players\n" 
  278. copy env:.dir.prefs guis:tools/prefs/players
  279. delete env:.dir.prefs
  280.  
  281. xROUTINE savefavs
  282. .temp = "GUIs:"
  283. ; check if fav directory exists
  284. joinfile $dir "tools/fav" favdir
  285. ifexists directory $favdir
  286.    else
  287.    makedir $favdir
  288. endif
  289. ; check & create fav files
  290. joinfile $dir "tools/fav/dirdef" favfile
  291. ifexists file $favfile            ; dir favourites files
  292.    else
  293.    copy env:.temp $favfile
  294. endif
  295. joinfile $dir "tools/fav/cedfav" favfile
  296. ifexists file $favfile            ; ced
  297.    else
  298.    copy env:.temp $favfile
  299. endif
  300. joinfile $dir "tools/fav/default" favfile
  301. ifexists file $favfile            ; default
  302.    else
  303.    copy env:.temp $favfile
  304. endif
  305.  
  306.  
  307.